﻿/*
 * Vytvořeno aplikací SharpDevelop.
 * Uživatel: lebeda
 * Datum: 30.5.2012
 * Čas: 7:54
 * 
 * Tento template můžete změnit pomocí Nástroje | Možnosti | Psaní kódu | Upravit standardní hlavičky souborů.
 */
using System;
using CommandLine;
using CommandLine.Text;
using System.Collections.Generic;


namespace updatedb
{
    class CmdOptions {
        [Option("o", "optimize", DefaultValue = false,
                HelpText = "Optimize index before commit changes.")]
        public bool Optimize { get; set; }
        
        [Option("a", "archives", DefaultValue = false,
                HelpText = "Expand filenames in archives "+LocateCommons.ARCHIVE_SUFFIX+"." +
                "Only if load list from filesystem, not from text file (in this case is option ignored).")]
        public bool Archive { get; set; }
        
        [Option("s", "store-index", DefaultValue = false,
                HelpText = "Store index of archives in separate text file.")]
        public bool storeIndexArchives { get; set; }        
        
        [Option("d", "delete", Required = false, HelpText = "Path to delete from index.")]
        public string pathToDelete { get; set; }
        
        [OptionArray("p", "path", Required = false, HelpText = "Paths or list files to index.")]
        public string[] pathToIndex { get; set; }

        [OptionList("x", "exclude", Separator = ':', Required = false,
                    HelpText = "Specify substrings for exclude (ie '\\.svn\\:\\.hg\\:\\.boar\\').")]
        public IList<string> excludeList { get; set; }
        
        [HelpOption]
        public string GetUsage() {
            var help = new HelpText(new HeadingInfo("updatedb", "0.1"));
            help.Copyright = new CopyrightInfo("Martin Lebeda", 2012, DateTime.Now.Year);
            help.AddPreOptionsLine("Update index for locate utilities. Powered on lucene.NET.");
            help.AddOptions(this);
            return help;
        }
    }
}
